<?php

use Doraemon\pockets\constInterface\EsDbFieldsMap;
use Doraemon\service\Event\Es\EsOperateMemberInfo;
use Doraemon\tools\Log;

/**
 * description
 *
 * @category   Module name
 * @package    PSR
 * @subpackage Documentation\API
 * @author     weiyizheng
 * @date       2022/8/31
 * @time       5:30 下午
 */

class EsOperateMemberAction extends ActionPlugin
{

	public function main()
	{
		Log::info('Es操作用户信息接收到的订阅消息', $this->messageBody);

		if (!$this->messageBody['table']) throw new \Exception('未获取到数据表');
		if (!$this->messageBody['data']) throw new \Exception('未接收到数据');

		if ($this->messageBody['table'] == EsDbFieldsMap::MEMBER_TABLE_MAP) EsOperateMemberInfo::operate($this->messageBody);

		$this->setSuccess();
	}
}